package com.su.ou.yang;

import java.util.Arrays;

public class Test10 {
    public static void main(String[] args) {

    }
    public static int solve(int[][] num){
        Arrays.sort(num, (int[]a,int[] b)->{
            return a[0]-b[0];
        });
        int count=0;
        int end=num[0][1];
        for (int i = 0; i < num.length ; i++) {
            if(num[i][0]<end){
                count++;
                end=Math.min(num[i][1],end);
            }
        }
        return count;

    }
}
